    {layout name='./base'}
    <div class="row">
      <div class="col-lg-12">
        <h1></h1>
        <h3 class="alert alert-success">文本消息</h3>
      </div>
    </div>
	<table class="table table-hover">
		<thead>
			<tr>
				<th>编号</th>
				<th>菜单名称</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			{foreach $list as $v}
			<tr>
				<td>{$v.id}</td>
				<td>{$v.name}</td>
				<td>
					{if $v.status === 0 }
					<a href="javaScript:if(confirm('确定要推送吗')){location.href='/button?id={$v.id}'}" class="btn btn-default">推送</a> 
					{else /}
					<button class="btn btn-success">已推送</button>
					{/if}
					<a href="/menu/{$v.id}/edit" class="btn btn-primary">编辑</a>
				</td>
			</tr>
			{/foreach}
		</tbody>
	</table>
	<script type="text/javascript">
		$('.del').click(function(){
			var _this = $(this);
			var id = _this.attr('num');
			$.ajax({
				type:"delete",
				url:"/textmsg/"+id+'?'+Math.random(),
				dataType: 'json',
				success: function(data){
					if(data===1){
						_this.parents('tr').hide();
					}
				}
			});
		})
	</script>
